{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Numpy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "\n",
    "openArray = np.array([1,2,3,3], dtype='float64')\n",
    "highArray = np.array([2,3,4,3], dtype='float64')\n",
    "lowArray = np.array([0.5, 1.5, 2.5,1.5], dtype='float64')\n",
    "closeArray = np.array([1.5, 2.5,3.5, 2.5], dtype='float64')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Pandas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "DatetimeIndex(['2018-08-08', '2018-08-09', '2018-08-10', '2018-08-11'], dtype='datetime64[ns]', freq='D')\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "timeIndex = pd.date_range(\"20180808\",periods=len(closeArray))\n",
    "print(timeIndex)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "candleDF = pd.concat([pd.Series(openArray), pd.Series(highArray), pd.Series(lowArray), pd.Series(closeArray)], axis=1, keys =('open', 'high', 'low', 'close') )\n",
    "candleDF.index = timeIndex"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## talib"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import talib as ta\n",
    "\n",
    "EMA = pd.Series(ta.EMA(closeArray,2), index=timeIndex)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## matplotlib & mpl_finance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from matplotlib.pylab import date2num\n",
    "\n",
    "candleDF['time'] = list(map(date2num, candleDF.index))\n",
    "candle = candleDF.reindex_axis([\"time\", \"open\", \"high\", \"low\", \"close\"], 1).values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA20AAAGfCAYAAADMNzrxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcXeV9H/7PM6N9JCGEVrQgJMCAMWYRi1eIU8c2IcGO\ncYKTJnE2gpv8+kt/SftL0v4SJ/0lbZI2jVO3Ugl2sJvUjhNvlNix49hstlkEBsxqS0IgCW0IkJDQ\nNjNP/5iLNJIlZiTN6B5p3u/X677m3nOec8/36plHM5855zyn1FoDAABAM3W0uwAAAAAOTWgDAABo\nMKENAACgwYQ2AACABhPaAAAAGkxoAwAAaDChDQAAoMGENgAAgAYT2gAAABpsVLt2PG3atLpgwYJ2\n7R4AAKCt7r///udqrdMHate20LZgwYIsW7asXbsHAABoq1LK04Np5/RIAACABhPaAAAAGkxoAwAA\naDChDQAAoMGENgAAgAYT2gAAABpMaAMAAGgwoQ0AAKDBhDYAAIAGE9oAAAAaTGgDAABoMKENAACg\nwQYd2kopnaWUb5dSbj3IulJK+fNSyvJSysOllIuGtkwAAICR6XCOtP3fSR4/xLp3JTmz9bg+yZKj\nrAsAAIAMMrSVUuYm+eEkNx2iyTVJPlH73J1kSill9hDVCAAAMGIN9kjbnyX5N0l6D7F+TpLV/V6v\naS0DAADgKAwY2kopVyfZWGu9/2h3Vkq5vpSyrJSybNOmTUf7dgDAie7mm9tdAUDbDeZI25uS/Ggp\nZVWSTyV5Wynlrw5oszbJvH6v57aW7afWemOtdXGtdfH06dOPsGQAYMRYtardFQC03YChrdb6W7XW\nubXWBUmuS/K1Wus/P6DZLUl+pjWL5OVJttRa1w19uQAAACPLqCPdsJRyQ5LUWpcm+WKSq5IsT/Jy\nkp8bkuoAAABGuMMKbbX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vLB0f/WQsHZt+ek/r33lXkg1Jvtxv3b9tve+Tac2ed5Dtjafm95Gx\n1P5+WpXk+STbWm3OPcj2xtIxfLwybSoAAAANNNQTkQAAADCEhDYAAIAGE9oAAAAaTGgDAABoMKEN\nAACgwYQ2AACABhPaAAAAGkxoAwAAaLD/AwfqGT0h2/Z2AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2143b384908>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import mpl_finance\n",
    "\n",
    "fig, (ax) = plt.subplots(1,1,sharex=True, figsize=(15,7))\n",
    "mpl_finance.candlestick_ohlc(ax, candle, width=0.6, colorup='r', colordown='g',alpha=1.0)\n",
    "ax.plot(EMA)\n",
    "ax.xaxis_date()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## requests & bs4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import requests\n",
    "r=requests.get(\"http://bbs.fxdayu.com\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from bs4 import BeautifulSoup\n",
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")\n",
    "bsObj=BeautifulSoup(r.text)\n",
    "topics=bsObj.findAll(\"div\",{\"class\":\"row\"})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'leon', 'zongzong', 'xinge', 'ukamoy', '叶蓝山', '吴欣亭', 'bboysky', 'bruce', 'Channel_CMT'}\n"
     ]
    }
   ],
   "source": [
    "name_list=[]\n",
    "for t in topics:\n",
    "    name=t.find(\"a\",{\"class\":\"username\"})\n",
    "    if  name:\n",
    "        name=name.text\n",
    "    else :\n",
    "        continue\n",
    "    name_list.append(name)\n",
    "print(set(name_list))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
